home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 24
/
AACD 24.iso
/
AACD
/
Online
/
AmiSSL
/
Install_AmiSSL
< prev
next >
Wrap
Text File
|
2001-07-20
|
8KB
|
317 lines
; $VER: Install_AmiSSL 1.0 (21.7.2001)
;
; © 2001 Andrija Antonijevic <TheAntony@bigfoot.com>
;
(set #cpu (database "cpu"))
(set #where-amissldir
(cat "Into which directory would you like to install AmiSSL "
"certificates and amissl command line utility? Directory "
"AmiSSL WILL be created there."
)
)
(set #where-libs
(cat "Into which directory should the library files be installed? "
"This directory MUST be part of your LIBS: assign. Directory "
"amissl will be created there."
)
)
(set #user-startup-msg
(cat "Installer needs to add AmiSSL: assign to user-startup "
"or AmiSSL won't be able to find its certificates."
)
)
(set #where-ciphers-dir
(cat "Please select the directory into which the archives "
"containing ciphers (blowfish.lha, des.lha, etc) "
"have been downloaded."
)
)
(set #ciphers-dir
(askdir (prompt #where-ciphers-dir)
(help @askdir-help)
(default "RAM:")
)
)
(if (exists "Work:")
(set #where-amissldir-default "Work:")
;else
(set #where-amissldir-default "SYS:")
)
(set #AmiSSLDir
(tackon
(askdir (prompt #where-amissldir)
(help @askdir-help)
(default #where-amissldir-default)
)
"AmiSSL"
)
)
(set #ask-path
(cat "Would you like Installer to add " #AmiSSLDir " directory "
"to the system path?"
)
)
(set #ask-path-help
(cat "If you select \"Yes\", you will be able to run \"amissl\" "
"command without specifying its full path."
)
)
(if (askbool (prompt #ask-path) (help #ask-path-help) (default 1))
(set #startup-command (cat "Assign AmiSSL: \"" #AmiSSLDir "\"\nPath AmiSSL: ADD\n"))
;else
(set #startup-command (cat "Assign AmiSSL: \"" #AmiSSLDir "\"\n"))
)
(set #LibsDir
(askdir (prompt #where-libs)
(help @askdir-help)
(default "LIBS:")
)
)
(set #CiphersLibsDir (tackon #LibsDir "amissl"))
(set #ask-main-lib-type "Which version of amissl.library would you like to install?")
(set #main-lib-type
(askchoice
(prompt #ask-main-lib-type)
(help @askchoice-help)
(choices "International version" "USA/Canada version")
(default 0)
)
)
(set #ask-CPU
(cat "AmiSSL comes in several versions for different processors. "
"Which version of AmiSSL would you like to install?"
)
)
(if (= #cpu "68060")
(set #default-cpu 3)
;else
(if (= #cpu "68040")
(set #default-cpu 2)
;else
(if (or (= #cpu "68020") (= #cpu "68030"))
(set #default-cpu 1)
;else
(set #default-cpu 0)
)
)
)
(set #cpu-id
(askchoice
(prompt #ask-CPU)
(help @askchoice-help)
(choices "68000" "68020" "68040" "68060")
(default #default-cpu)
)
)
(procedure P_Cleanup
(makeassign "AmiSSLInstall")
(delete "T:AmiSSLTemp" (all))
)
(procedure P_InstallMainLibrary #lib-type #cpu-index #destination
; USA/Canada 68000 version is in the archive
(if (and (= #lib-type 1) (= #cpu-index 0))
(copylib
(source "AmiSSLInstall:lib/amissl_usa_000.library")
(dest #destination)
(newname "amissl.library")
)
;else
(
(set #patch-name
(cat
(select #lib-type "amissl_int_" "amissl_usa_")
(select #cpu-index "000" "020" "020" "020")
".pch"
)
)
(working "Patching amissl.library. Please wait...")
(set #result-code
(run
(cat "AmiSSLInstall:bin/spatch "
"-oT:AmiSSLTemp/amissl.library "
"-pAmiSSLInstall:lib/" #patch-name " "
"AmiSSLInstall:lib/amissl_usa_000.library"
)
(safe)
)
)
(if (<> #result-code 0) (abort "Error while patching amissl.library"))
(copylib
(source "T:AmiSSLTemp/amissl.library")
(dest #destination)
)
)
)
)
(procedure P_GetCipherFileName #name #cpu-index
(if (= #name "blowfish")
(set #ext (select #cpu-index ".000" ".020-030-060" ".040" ".020-030-060"))
(if (= #name "cast")
(set #ext (select #cpu-index ".000" ".020-030-060" ".040" ".020-030-060"))
(if (= #name "des")
(set #ext (select #cpu-index ".000" ".020-030-060" ".040" ".020-030-060"))
(if (= #name "idea")
(set #ext (select #cpu-index ".000" ".020-030-060" ".040" ".020-030-060"))
(if (= #name "md2")
(set #ext (select #cpu-index ".000" ".020-030-040-060" ".020-030-040-060" ".020-030-040-060"))
(if (= #name "md5")
(set #ext (select #cpu-index ".000" ".020-030-040-060" ".020-030-040-060" ".020-030-040-060"))
(if (= #name "mdc2")
(set #ext "")
(if (= #name "rc2")
(set #ext (select #cpu-index ".000" ".020-030-060" ".040" ".020-030-060"))
(if (= #name "rc4")
(set #ext (select #cpu-index ".000" ".020-030-060" ".040" ".020-030-060"))
(if (= #name "rc5")
(set #ext (select #cpu-index ".000" ".020-030" ".040" ".060"))
(if (= #name "ripemd")
(set #ext (select #cpu-index ".000" ".020-030-040-060" ".020-030-040-060" ".020-030-040-060"))
(if (= #name "sha")
(set #ext (select #cpu-index ".000" ".020-030-040-060" ".020-030-040-060" ".020-030-040-060"))
;else
(abort "Unknown cipher/message digest " #name ". Please write "
"to the author quoting this message."
)
))))))))))))
(set #result (cat #name ".library" #ext))
)
(set #mdc2-des-error
(cat "You have downloaded MDC2 message digest but choose not to "
"download DES cipher. Since MDC2 requires DES to operate, "
"AmiSSL will be installed as if you haven't downloaded "
"MDC2 digest."
)
)
(procedure P_ExtractCipher #name #cpu-index
(set #cipher-filename (P_GetCipherFileName #name #cpu-index))
(set #result-code
(run
(cat "AmiSSLInstall:bin/lhex -qaFw=T:AmiSSLTemp/ x "
"\"" (tackon #ciphers-dir #name) ".lha\" "
#cipher-filename
)
(safe)
)
)
(if (<> #result-code 0) (abort "Error while extracting files from archive " #name ".lha"))
(rename (cat "T:AmiSSLTemp/" #cipher-filename) (cat "T:AmiSSLTemp/" #name ".library") (safe))
)
(procedure P_InstallCipher #name #cpu-index #destination
(set #cipher-exists (exists (cat (tackon #ciphers-dir #name) ".lha")))
(if (and (and #cipher-exists (= #name "mdc2")) (not (exists (tackon #ciphers-dir "des.lha"))))
(
(message #mdc2-des-error)
(set #cipher-exists 0)
)
)
(if #cipher-exists
(
(P_ExtractCipher #name #cpu-index)
(copylib
(source (cat "T:AmiSSLTemp/" #name ".library"))
(dest #destination)
)
)
;else
(copylib
(source (cat "AmiSSLInstall:dummy_ciphers/" #name ".library"))
(dest #destination)
)
)
)
(onerror (P_Cleanup))
(complete 0)
(makeassign "AmiSSLInstall" (expandpath "") (safe))
(makedir #CiphersLibsDir)
(makedir "T:AmiSSLTemp")
(P_InstallMainLibrary #main-lib-type #cpu-id #LibsDir)
(complete 25)
(P_InstallCipher "blowfish" #cpu-id #CiphersLibsDir)
(complete 30)
(P_InstallCipher "cast" #cpu-id #CiphersLibsDir)
(complete 35)
(P_InstallCipher "des" #cpu-id #CiphersLibsDir)
(complete 40)
(P_InstallCipher "idea" #cpu-id #CiphersLibsDir)
(complete 45)
(P_InstallCipher "md2" #cpu-id #CiphersLibsDir)
(complete 50)
(P_InstallCipher "md5" #cpu-id #CiphersLibsDir)
(complete 55)
(P_InstallCipher "mdc2" #cpu-id #CiphersLibsDir)
(complete 60)
(P_InstallCipher "rc2" #cpu-id #CiphersLibsDir)
(complete 65)
(P_InstallCipher "rc4" #cpu-id #CiphersLibsDir)
(complete 70)
(P_InstallCipher "rc5" #cpu-id #CiphersLibsDir)
(complete 75)
(P_InstallCipher "ripemd" #cpu-id #CiphersLibsDir)
(complete 80)
(P_InstallCipher "sha" #cpu-id #CiphersLibsDir)
(complete 85)
(makedir #AmiSSLDir (infos))
(copyfiles
(source "AmiSSLInstall:AmiSSLDir")
(dest #AmiSSLDir)
(infos)
(all)
)
(complete 95)
(startup @app-name
(prompt #user-startup-msg)
(help @startup-help)
(command #startup-command)
)
(P_Cleanup)
(complete 100)
(set @default-dest #LibsDir)
(exit "AmiSSL installation finished succesfully. Enjoy!")